package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.pojo.Food;
import com.itheima.service.FoodListService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author 林晓伟
 */
@RestController
@RequestMapping("/dish")
public class FoodListController {
    @Resource
    private FoodListService foodListService;

    /**
     * F14-菜品列表
     *
     * @param categoryId 分类Id
     * @param status     状态
     */
    @GetMapping("/list")
    public R a(@RequestParam String categoryId, Integer status) {
        List<Food> a = foodListService.a(categoryId, status);
        return R.success(a);
    }
}
